package com.woniuxy.counter.entity;

import lombok.Data;

@Data
public class ResponseEntity<T> {
    private int code;
    private String message;
    private T data;
    public static ResponseEntity<Void> success = new ResponseEntity<>(200, "ok");

    public ResponseEntity() {

    }

    public ResponseEntity(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseEntity(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseEntity(T data) {
        this.code = 200;
        this.message = "ok";
        this.data = data;
    }
}
